<div>
	<yu-panel title="触发器管理" v-loading="exportLoading">
		<yu-row :gutter="24">
			<yu-col :span="5">
				<yu-xtree ref="refTree" :height="height - 20" @node-click="nodeClickFn" :data-url="treeDataUrl" data-id="appCode" data-label="appName"
				 data-pid="parentId" :data-async="async" data-root="0000" style="margin:10px 10px 0 0;" icon="iconPath">
				</yu-xtree>
			</yu-col>
			<yu-col :span="19">
				<yu-xform related-table-name="refTable" form-type="search" v-model="searchFormdata">
					<yu-xform-group :column="4">
						<yu-xform-item label="系统名称" placeholder="系统名称" ctype="input" name="appName" :disabled="appNameDisabled"></yu-xform-item>
						<yu-xform-item label="触发器名称" placeholder="触发器名称" ctype="input" name="timerName"></yu-xform-item>
					</yu-xform-group>
				</yu-xform>
				<yu-toolBar>
					<yu-button @click="addFn" v-if="nodeLeaf&&addFnButton">新增</yu-button>
					<yu-button @click="modifyFn" v-if="updateFnButton">修改</yu-button>
					<yu-button @click="deleteFn" v-if="deleteFnButton">删除</yu-button>
					<yu-button @click="importFlowFn" v-if="importFnButton">excel导入</yu-button>
					<yu-button @click="exportFlowFn" v-if="exportFnButton">excel导出</yu-button>
				</yu-toolBar>
				<div ref="tableBox" style="overflow: auto;">
					<yu-xtable :height="tbHeight" ref="refTable" row-number :data-url="dataUrl" selection-type="checkbox">
						<yu-xtable-column label="系统名称" prop="appName" :show-overflow-tooltip="true" sortable v-if="appCodeShow"></yu-xtable-column>
						<yu-xtable-column label="触发器名称" prop="timerName" :show-overflow-tooltip="true">
							<template slot-scope="scope">
								<a style="text-decoration:underline;color:#636CE4ff " href="javascipt:void(0);" @click="viewDataFn(scope.row)">{{ scope.row.timerName }}</a>
							</template>
						</yu-xtable-column>
						<yu-xtable-column label="开始日期" prop="effectDate"></yu-xtable-column>
						<yu-xtable-column label="结束日期" prop="expireDate"></yu-xtable-column>
						<yu-xtable-column label="表达式" prop="expression" :show-overflow-tooltip="true"></yu-xtable-column>
						<yu-xtable-column label="备注" prop="remark" :show-overflow-tooltip="true"></yu-xtable-column>
					</yu-xtable>
				</div>
				<yu-xdialog :title="viewTitle" :visible.sync="dialogVisible" width="900px">
					<yu-xform ref="refForm" v-model="formdata" label-width="120px" :rules="rules">
						<yu-xform-group>
							<yu-xform-item label="系统名称" ctype="input" name="appName" disabled></yu-xform-item>
							<yu-xform-item label="触发器编码" ctype="input" maxlength="64" name="timerCode" :disabled="isReadOnly"></yu-xform-item>
							<yu-xform-item label="触发器名称" ctype="input" maxlength="120" name="timerName" rules="required"></yu-xform-item>
							<yu-xform-item label="开始时间" ctype="datepicker" name="startTime" value-format="yyyyMMdd" format="yyyyMMdd" rules="required"></yu-xform-item>
							<yu-xform-item label="结束时间" ctype="datepicker" name="endTime" value-format="yyyyMMdd" format="yyyyMMdd"></yu-xform-item>
							<yu-xform-item label="定义类型" @change="changeMethod" ctype="select" name="configMethod"  data-code="CONFIG_METHOD" rules="required"></yu-xform-item>
							<yu-xform-item label="执行频率" ctype="select" name="execTimes" data-code="USE_EXEC_TIMES" rules="required" :hidden="formdata.configMethod==='0'"
							 @change="changeExecTimes"></yu-xform-item>
							<yu-xform-item label="执行方式" ctype="select" name="execMethod" :options="execMethod" rules="required" :hidden="formdata.configMethod==='0'"
							 @change="changeExecMethod"></yu-xform-item>

							<yu-xform-item label="单位" ctype="select" name="unit" data-code="USE_EXEC_UNIT" rules="required" :hidden="formdata.configMethod==='0'||formdata.execMethod==='E'"></yu-xform-item>
							<yu-xform-item label="间隔时间" ctype="input" name="intervalTime" :hidden="formdata.configMethod==='0'||formdata.execMethod==='E'"
							 :rules="intervalTimeRule"></yu-xform-item>
							<yu-xform-item label="执行时间" ctype="input" name="execTime" :hidden="formdata.configMethod==='0'||formdata.execMethod==='I'"
							 :rules="intervalDateTimeRule"></yu-xform-item>
							<yu-xform-item label="克隆表达式" ctype="input" colspan="24" :disabled="formdata.configMethod==='1'" name="expression"></yu-xform-item>
							<yu-xform-item label="备注" ctype="textarea" colspan="24" name="remark" rowspan="3"></yu-xform-item>
						</yu-xform-group>
					</yu-xform>
					<div class="yu-grpButton">
						<yu-button @click="cancelFn">取消</yu-button>
						<yu-button type="primary" v-if="!isView" @click="saveFn" :disabled="isView">保存</yu-button>
						<yu-button type="info" v-if="isView" @click="saveFn" :disabled="isView">保存</yu-button>
					</div>
				</yu-xdialog>
			</yu-col>

		</yu-row>
	</yu-panel>
	
	
	<yu-dialog title="excel导入" :visible.sync="upLoadDialogVisible" width="400px" v-loading="excelloading">
					<yu-upload class="upload-demo" ref="my-upload" :action="upLoadUrl" accept=".xls,.xlsx" :before-upload="checkUpload"
						 :multiple="multipleFalg"	:on-success="successUpload" :file-list="appUploadDatas">
						<yu-button size="small" type="primary">点击上传</yu-button>
						<a slot="tip" class="downloadcss" @click="exportDemo">模板下载</a>
						<div slot="tip" class="el-upload__tip">只能上传excel文件，且不超过100M</div>
					</yu-upload>
					<div class="uplaod-errinfo" v-if="errshow">
						<yu-tag type="danger">上传失败，错误信息如下：</yu-tag>
						<div class="uplaod-errlist">
								<yu-table :data="errdata" highlight-current-row style="width:100%" show-header>
									<yu-table-column type="index"  width="50">
										
									</yu-table-column>
									<yu-table-column prop="errMsg" label="错误信息">
										
									</yu-table-column>
								</yu-table>	
						</div>
					</div>
	</yu-dialog>

</div>
<style type="text/css">
	.downloadcss{
		cursor: pointer;
		margin-left:10px;
	}
</style>